package com.ruoyi.project.system.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.utils.SecurityUtils;
import lombok.Data;
import java.util.Date;

@Data
public class SmAutonomy {

    private Integer id;

    private Long userId;

    private String type;

    private String name;

    private String cardNo;

    private String tel;

    private String pass;

    private String msg;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    public SmAutonomy() {
    }

    public SmAutonomy(String name, String cardNo, String tel) {
        this.userId = SecurityUtils.getUserId();
        this.type = "2";
        this.name = name;
        this.cardNo = cardNo;
        this.tel = tel;
        this.pass ="0";
    }

    public SmAutonomy(SmQuery smQuery) {
        this.type = "1";
        this.userId = smQuery.getUserId();
        this.name = smQuery.getName();
        this.cardNo = smQuery.getCardNo();
        this.tel = smQuery.getTel();
        this.pass = "0";
    }
}
